//
//  FreeManagerSelfFoutTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/8.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "FreeManagerSelfFoutTableViewCell.h"

@implementation FreeManagerSelfFoutTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        GLGWLabel *nameLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:kColor_Rule_Black inSuperView:self.contentView];
        NSString *str = @"自由经理人权益";
        nameLab.text = str;
        [nameLab mas_updateConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(self.contentView.mas_top).offset(kWidthProportion_In_iPhoneTriploid(17));
            make.bottom.equalTo(@(-kHeightProportion_In_iPhoneTriploid(118)));
        }];
        
        GLGWView *letV = [[GLGWView alloc] initWithInSuperView:self.contentView];
        [letV setViewShadowWidth:3.0 theCornerRadius:12];
        [letV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(39));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(142)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(92)));
            make.top.equalTo(nameLab.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(17));
        }];
        letV.backgroundColor = [UIColor whiteColor];
        GLGWButton *letBtn = [[GLGWButton alloc] initWithTitle:@"" titleLableFont:SYSTEMFONT(14) titleLableColor:[UIColor colorWithHexString:@"#999999"] inSuperView:letV];
        [letBtn setBackgroundImage:[UIImage imageNamed:@"icon_zhuanshuzhaohuoshenqi"] forState:UIControlStateNormal];
        [letBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.equalTo(letV);
        }];
        [letBtn addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];

        GLGWView *riV = [[GLGWView alloc] initWithInSuperView:self.contentView];
        [riV setViewShadowWidth:3.0 theCornerRadius:12];
        [riV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(letBtn.mas_right).offset(kWidthProportion_In_iPhoneTriploid(21));
            make.width.equalTo(letBtn.mas_width);
            make.height.equalTo(letBtn.mas_height);
            make.centerY.equalTo(letBtn.mas_centerY);
        }];
        riV.backgroundColor = [UIColor whiteColor];

        GLGWButton *rightBtn = [[GLGWButton alloc] initWithTitle:@"" titleLableFont:SYSTEMFONT(14) titleLableColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        [rightBtn setBackgroundImage:[UIImage imageNamed:@"icon_zhuanshuhailiangmaijiaziliao"] forState:UIControlStateNormal];
        [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.bottom.equalTo(riV);
        }];
        [rightBtn addTarget:self action:@selector(rightAction:) forControlEvents:UIControlEventTouchUpInside];

        
    }
    return self;
}


- (void)leftAction:(GLGWButton *)sender
{
    if (self.BlockLeft) {
        self.BlockLeft(sender);
    }
}

- (void)rightAction:(GLGWButton *)sender
{
    if (self.BlockRight) {
        self.BlockRight(sender);
    }
}

@end
